from typing import *


class SegmentTree:

    def __init__(self, n: int) -> None:
        self.n = n
        self.adds = [0] * (self.n << 2)

    def add(self, L, R, val):
        self.__add(0, self.n, 1, L, R, val)

    def query(self, L):
        return self.__query(0, self.n, 1, L, L)

    def __push(self, root):
        if self.adds[root] != 0:
            self.adds[root << 1] += self.adds[root]
            self.adds[root << 1 | 1] += self.adds[root]
            self.adds[root] = 0

    def __add(self, l, r, root, L, R, val):
        if L <= l and r <= R:
            self.adds[root] += val
            return
        self.__push(root)
        m = ((r - l) >> 1) + l
        if L <= m:
            self.__add(l, m, root << 1, L, R, val)
        if R > m:
            self.__add(m + 1, r, root << 1 | 1, L, R, val)

    def __query(self, l, r, root, L, R):
        if L <= l and r <= R:
            return self.adds[root]
        self.__push(root)
        m = ((r - l) >> 1) + l
        if L <= m:
            return self.__query(l, m, root << 1, L, R)
        if R > m:
            return self.__query(m + 1, r, root << 1 | 1, L, R)


class Solution:
    def countOfPairs(self, n: int, x: int, y: int) -> List[int]:
        ans = [0] * n
        x, y = min(x, y), max(x, y)
        r = n - y
        st = SegmentTree(n)
        z = (y - x + 2) // 2
        for i in range(1, y):
            if y - i > abs(i - x) + 1:
                st.add(y - i, y - i + r, -1)
                st.add(abs(i - x) + 1, abs(i - x) + 1 + r, 1)
            if i > x and i < y and y - 1 - i > i - x + 2:
                st.add(z, y - 1 - i, -1)
                st.add(i - x + 2, y - x + 1 - z, 1)
        z = (x + y + 2) // 2
        l = x - 1
        for i in range(z, y):
            st.add(i - x, i - x + l, -1)
            st.add(y - i + 1, y - i + 1 + l, 1)
        for i in range(1, n + 1):
            ans[i - 1] = (n - i + st.query(i)) * 2
        return ans


s = Solution()
from datetime import datetime

l = datetime.now().timestamp()
print(a := s.countOfPairs(8, 8, 1), b := [16, 16, 16, 8, 0, 0, 0, 0], a == b)
print(s.countOfPairs(7, 1, 7) == [14, 14, 14, 0, 0, 0, 0])
print(s.countOfPairs(n=3, x=1, y=3) == [6, 0, 0])
print(s.countOfPairs(4, 1, 1) == [6, 4, 2, 0])
print(a := s.countOfPairs(8, 4, 7), b := [16, 16, 12, 8, 4, 0, 0, 0], a == b)
print(a := s.countOfPairs(6, 1, 5), b := [12, 14, 4, 0, 0, 0], a == b)

# print(datetime.now().timestamp() - l)
# l = datetime.now().timestamp()
# s.countOfPairs(100000, 7374, 93602)
# print(datetime.now().timestamp() - l)
